/*
 Copyright 2007 Ole Rogeberg

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
 */
package org.lifeyears.model;

import java.io.Serializable;

import javax.persistence.Embeddable;

import org.hibernate.annotations.AccessType;
import org.hibernate.validator.Length;
import org.lifeyears.model.utils.ToStringUtil;

/**
 * A class representing an address.
 * 
 * @author Aleksander Blomskøld
 */
@Embeddable
@AccessType( value = "field" )
public class Address
    implements Serializable
{

    @Length( max = 50 )
    private String streetName;

    @Length( max = 10 )
    private String streetNumber;

    @Length( max = 10 )
    private String streetFloor;

    @Length( max = 4 )
    private String postalCode;

    @Length( max = 30 )
    private String postalPlace;

    public String getPostalCode()
    {
        return postalCode;
    }

    public void setPostalCode( final String postalCode )
    {
        this.postalCode = postalCode;
    }

    public String getPostalPlace()
    {
        return postalPlace;
    }

    public void setPostalPlace( final String postalPlace )
    {
        this.postalPlace = postalPlace;
    }

    public String getStreetFloor()
    {
        return streetFloor;
    }

    public void setStreetFloor( final String streetFloor )
    {
        this.streetFloor = streetFloor;
    }

    public String getStreetName()
    {
        return streetName;
    }

    public void setStreetName( final String streetName )
    {
        this.streetName = streetName;
    }

    public String getStreetNumber()
    {
        return streetNumber;
    }

    public void setStreetNumber( final String streetNumber )
    {
        this.streetNumber = streetNumber;
    }

    @Override
    public String toString()
    {
        return ToStringUtil.toString( this );
    }
}